#ifndef ENTITY_H_INCLUDED
#define ENTITY_H_INCLUDED

#include <sheeplib/model/model.h>
#include <boost/shared_ptr.hpp>
#include <string>
#include "resources/texturemanager.h"
#include "resources/materialmanager.h"

using boost::shared_ptr;
using namespace sheeplib::model;
using std::string;

namespace engine {
		
	namespace scene {
		
		using engine::resources::TextureManager;
		using engine::resources::MaterialManager;
		
		class Entity {
			private:
				shared_ptr<Model> m_Mesh;
				string m_Name;
				
				shared_ptr<TextureManager> m_TextureManager;
				shared_ptr<MaterialManager> m_MaterialManager;
				
			public:
				Entity(const string& name);
				virtual ~Entity();
				
				shared_ptr<Model> getMesh();
				shared_ptr<Entity> clone(const string& newName); ///< Create a clone of this entity and return a pointer
				
				string getName();
				void useMesh(const string& mesh);
				
				virtual void render();
				
				void setTextureManager(shared_ptr<TextureManager> tex) {
					m_TextureManager = tex;
				}
				
				void setMaterialManager(shared_ptr<MaterialManager> mat) {
					m_MaterialManager = mat;
				}
				
				shared_ptr<TextureManager> getTextureManager() { 
					return m_TextureManager;					
				}	
				
				shared_ptr<MaterialManager> getMaterialManager() {
					return m_MaterialManager;
				}
		};
	}
}

#endif // ENTITY_H_INCLUDED
